<?php

class multitender_model_banerRedirect extends multitender_model {

    function  __construct() {
        parent::__construct();
        $this->db_person = & $this->conf['dbs']['person'];
    }

    function plusOne($link) {
        $sql = 'INSERT INTO clicks (`id`,`date`) VALUES (' . $link . ', ' . ((time()-345600)/604800) . ')';
        $this->db_person->Execute($sql);
        $sql = 'SELECT link FROM baners WHERE id = ' . $link;
        $link = $this->db_person->GetOne($sql);
        return $link;
    }

    function getLink($link) {
        $sql = 'SELECT link FROM baners WHERE id = ' . $link;
        $link = $this->db_person->GetOne($sql);
        return $link;
    }
}